<template>
    <div id="app" name="app" @scroll="handleScroll">
        <el-container style="display: block; background-color: #e9e9e9;">
            <!-- 顶部导航栏 -->
            <TopHeader :login-user="loginUser" :car-count="carCount"/>
            
            <!-- 顶栏容器 -->
            <MainHeader :active-index="activeIndex"/>
    
            <!-- Material PageHeader -->
            
            <!-- 轮播图 -->
            <SwiperPage/>
            
            <!-- 主要区域容器 -->
            <el-main>
                <keep-alive style="height: 550px;">
                    <router-view :key="$route.fullPath"></router-view>
                </keep-alive>
            </el-main>
            
            <!-- 底栏容器 -->
            <Footer/>
        </el-container>
    </div>
</template>

<script>

import TopHeader from "@/components/home/Top-Header";
import MainHeader from "@/components/home/Main-Header"
import Footer from "@/components/home/Footer";
import Login from "@/views/Login";
import Register from "@/views/Register";
import SwiperPage from "@/components/swiper/SwiperPage";

import PageHeader from "@/views/material/PageHeader";

export default {
    name: "home",
    components: {
        SwiperPage,
        Register,
        Login,
        TopHeader,
        MainHeader,
        Footer,
        
        PageHeader
    },
    data() {
        return {
            activeIndex: "/", // 头部导航栏选中的标签
            search: "", // 搜索条件
            register: false, // 是否显示注册组件
            visible: false, // 是否退出登录
            loginUser: sessionStorage.getItem("admin-userName") || '游客',
            carCount: sessionStorage.getItem("admin-carNum") || '0',
        };
    },
    created() {
    },
    watch: {},
    methods: {
        handleScroll() {
            console.log(">>>>>>>>>")
        },
    }
};
</script>

<style>
/* 全局CSS */
* {
    padding: 0;
    margin: 0;
    border: 0;
    list-style: none;
}

#app .el-header {
    padding: 0;
}

#app .el-main {
    min-height: 350px;
    padding: 20px 0;
}

#app .el-footer {
    padding: 0;
}

a,
a:hover {
    text-decoration: none;
}

/* 全局CSS END */

/* 顶部导航栏CSS */
.topbar {
    height: 40px;
    background-color: #3d3d3d;
    margin-bottom: 20px;
}

.topbar .nav {
    width: 1225px;
    margin: 0 auto;
}

.topbar .nav ul {
    float: right;
}

.topbar .nav li {
    float: left;
    height: 40px;
    color: #b0b0b0;
    font-size: 14px;
    text-align: center;
    line-height: 40px;
    margin-left: 20px;
}

.topbar .nav .sep {
    color: #b0b0b0;
    font-size: 12px;
    margin: 0 5px;
}

.topbar .nav li .el-button {
    color: #b0b0b0;
}

.topbar .nav .el-button:hover {
    color: #fff;
}

.topbar .nav li a {
    color: #b0b0b0;
}

.topbar .nav a:hover {
    color: #fff;
}

.topbar .nav .shopCart {
    width: 120px;
    background: #424242;
}

.topbar .nav .shopCart:hover {
    background: #fff;
}

.topbar .nav .shopCart:hover a {
    color: #ff6700;
}

.topbar .nav .shopCart-full {
    width: 120px;
    background: #ff6700;
}

.topbar .nav .shopCart-full a {
    color: white;
}

/* 顶部导航栏CSS END */

/* 顶栏容器CSS */
.el-header .el-menu {
    max-width: 1225px;
    margin: 0 auto;
}

.el-header .logo {
    height: 60px;
    width: 189px;
    float: left;
    margin-right: 100px;
}

.el-header .so {
    margin-top: 10px;
    width: 300px;
    float: right;
}

/* 顶栏容器CSS END */

/* 底栏容器CSS */
.footer {
    width: 100%;
    text-align: center;
    background: #2f2f2f;
    padding-bottom: 10px;
}


.footer .ng-promise-box {
    margin: 0 auto;
    border-bottom: 1px solid #3d3d3d;
    line-height: 80px;
}

.footer .ng-promise-box .ng-promise p a {
    color: #fff;
    font-size: 20px;
    margin-right: 210px;
    padding-left: 44px;
    height: 40px;
    display: inline-block;
    line-height: 40px;
    text-decoration: none;
    background: url("../assets/imgs/us-icon.png") no-repeat left 0;
}

.footer .github {
    height: 50px;
    line-height: 50px;
    margin-top: 20px;
}

.footer .github .github-but {
    width: 50px;
    height: 50px;
    margin: 0 auto;
    background: url("../assets/imgs/github.png") no-repeat;
}

.footer .mod_help {
    text-align: center;
    color: #888888;
}

.footer .mod_help p {
    margin: 20px 0 16px 0;
}

.footer .mod_help p a {
    color: #888888;
    text-decoration: none;
}

.footer .mod_help p a:hover {
    color: #fff;
}

.footer .mod_help p span {
    padding: 0 22px;
}

/* 底栏容器CSS END */

.el-pagination__jump {
    font-weight: 400;
    color: #606266;
}

</style>
